package com.ztewatch.wearcontacts.view;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

public class GroupMembershipAdapter<T> extends ArrayAdapter<T> {

	private int cur_pos = 0;

	public GroupMembershipAdapter(Context context, int resource) {
		super(context, resource);
	}

	public void setCurPosition(int pos) {
		cur_pos = pos;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View v = super.getView(position, convertView, parent);
		if (position == cur_pos) {
			v.setBackgroundColor(Color.LTGRAY);
		} else {
			v.setBackgroundColor(Color.TRANSPARENT);
		}
		return v;
	}
}
